
//-----------------MATRICES---------------
float4x4 xWorld: World;				
float4x4 xView: View;
float4x4 xProjection: Projection;

//-----------------TEXTURES---------------

Texture t_gauss;
sampler gauss_s = sampler_state { texture = <t_gauss> ;
    magfilter = LINEAR; minfilter = LINEAR; mipfilter=LINEAR; AddressU = mirror; AddressV = mirror;};
   


Texture xTexture;
sampler ColoredTextureSampler = sampler_state { texture = <xTexture> ;
    magfilter = LINEAR; minfilter = LINEAR; mipfilter=LINEAR; AddressU = mirror; AddressV = mirror;};
   
   Texture smap;
sampler smaps = sampler_state { texture = <smap> ;
    magfilter = LINEAR; minfilter = LINEAR; mipfilter=LINEAR; AddressU = mirror; AddressV = mirror;};
     
    
sampler ColoredTextureSamplerNN = sampler_state { texture = <xTexture> ;
    magfilter = POINT; minfilter = POINT; mipfilter=POINT; AddressU = mirror; AddressV = mirror;};
 
 
 textureCUBE xCubeShadowMap; 
samplerCUBE CubeShadowMapSampler = sampler_state
{
	Texture = <xCubeShadowMap>;
    MipFilter = LINEAR;
    MinFilter = LINEAR;
    MagFilter = LINEAR;
    AddressU = wrap;
    AddressV = wrap;
};

samplerCUBE CubeShadowMapSampler2 = sampler_state
{
	Texture = <xCubeShadowMap>;
    MipFilter = LINEAR;
    MinFilter = POINT;
    MagFilter = POINT;
    AddressU = wrap;
    AddressV = wrap;
};

 textureCUBE xReflectionCube; 
samplerCUBE ReflectionCubeSampler = sampler_state
{
	Texture = <xReflectionCube>;
    MipFilter = LINEAR;
    MinFilter = LINEAR;
    MagFilter = LINEAR;
    AddressU = wrap;
    AddressV = wrap;
};

samplerCUBE ReflectionCubeSampler2 = sampler_state
{
	Texture = <xReflectionCube>;
    MipFilter = LINEAR;
    MinFilter = LINEAR;
    MagFilter = LINEAR;
    AddressU = wrap;
    AddressV = wrap;
};

 textureCUBE ref_old;
  samplerCUBE rold = sampler_state
{
	Texture = <ref_old>;
    MipFilter = LINEAR;
    MinFilter = LINEAR;
    MagFilter = LINEAR;
    AddressU = wrap;
    AddressV = wrap;
};
 
//-----------------CONSTANTS----------------

float4 xLightPosition;
float4 xCameraPosition;
float shininess;
float4 c_ambient;
  float4 c_diffuse;
  float4 c_specular;
  float t_size;
  float t_mod;
  float4x4 xRotationMatrix;


float d_2;

//------------------- STRUCTS -------------------   


struct BufferToVertex
{
float3 Pos : POSITION;
float4 Normal : NORMAL;
float4 UV : TEXCOORD0;
};


struct VertexToPixel
{
float4 Pos:POSITION;
float4 UV:TEXCOORD0;
float4 Pos3D:TEXCOORD1;
float4 Normal:TEXCOORD2;
float4 Pos2:TEXCOORD3;
};

struct VertexToPixelTex
{
float4 Pos:POSITION;
float4 UV:TEXCOORD0;
float4 Normal:TEXCOORD2;
};


struct PixelToFrame
{
float4 Color:COLOR;
};


struct PSCubeIn
{
    float4 oPositionLight : POSITION;
    float3 lightVec       : TEXCOORD0;
};





float IsInShadow(float3 LightPos, float3 inObjPos)
{
     float4 PLightDirection = 0.0f;
     PLightDirection.xyz = LightPos.xyz - inObjPos;
     float distance = length(PLightDirection.xyz);
     PLightDirection.xyz = PLightDirection.xyz / distance;     
     float shadowMapDepth = texCUBE(CubeShadowMapSampler, float4(-(PLightDirection.xyz), 0)).r;   
      float s3 = texCUBE(CubeShadowMapSampler2, float4(-(PLightDirection.xyz), 0)).r;                		 
	 float s2 = texCUBEbias(CubeShadowMapSampler, float4(-(PLightDirection.xyz), 3)).r;


float diff = distance - shadowMapDepth;
float edge = abs(s3 - s2);

return diff-(edge/2);

return abs(s3 - s2);
}

float IsInShadow3(float3 LightPos, float3 inObjPos)
{
     float4 PLightDirection = 0.0f;
     PLightDirection.xyz = LightPos.xyz - inObjPos;
     float distance = length(PLightDirection.xyz);
     PLightDirection.xyz = PLightDirection.xyz / distance;
     
     float4 s = float4(-(PLightDirection.xyz), 0);
     float d = d_2;
    
	 float a = acos(s.z);
	 float b = atan2(s.y, s.x);
	 
	 float sa = sin(a);
	 float sb = sin(b);
	 float ca = cos(a);
	 float cb = cos(b);
	 float sa1 = sin(a+d);
	 float sa2 = sin(a-d);
	 float sb1 = sin(b+d);
	 float sb2 = sin(b-d);
	 float ca1 = cos(a+d);
	 float ca2 = cos(a-d);
	 float cb1 = cos(b+d);
	 float cb2 = cos(b-d);
    
     float smd = texCUBE(CubeShadowMapSampler, s).r;   
     
     
     float t1 = (+float(texCUBE(CubeShadowMapSampler, float4(sa1*cb1, sa1*sb1, ca1, 0) ).r > distance)
                 +float(texCUBE(CubeShadowMapSampler, float4(sa1*cb , sa1*sb , ca1, 0) ).r > distance)
                 +float(texCUBE(CubeShadowMapSampler, float4(sa1*cb2, sa1*sb2, ca1, 0) ).r > distance)
                 +float(texCUBE(CubeShadowMapSampler, float4(sa2*cb1, sa2*sb1, ca2, 0) ).r > distance)
                 +float(texCUBE(CubeShadowMapSampler, float4(sa2*cb , sa2*sb , ca2, 0) ).r > distance)
                 +float(texCUBE(CubeShadowMapSampler, float4(sa2*cb2, sa2*sb2, ca2, 0) ).r > distance)
				 +float(distance < smd)
                 +float(texCUBE(CubeShadowMapSampler, float4(sa *cb1, sa *sb1, ca , 0) ).r > distance)
                 +float(texCUBE(CubeShadowMapSampler, float4(sa *cb2, sa *sb2, ca , 0) ).r > distance)
                 );
	
	return t1/9;

}

bool IsInShadow2(float3 LightPos, float3 inObjPos)
{
     float4 PLightDirection = 0.0f;
     PLightDirection.xyz = LightPos.xyz - inObjPos;
     float distance = length(PLightDirection.xyz);
     PLightDirection.xyz = PLightDirection.xyz / distance;
     
    
   
     float shadowMapDepth = texCUBE(CubeShadowMapSampler, float4(-(PLightDirection.xyz), 0)).r;   

	 
	
	 if(distance > shadowMapDepth)   return true;	      	
	 else return false;
}

//---------------------- SHADERS ------------------------

VertexToPixel lightedVS(BufferToVertex IN)
{
  VertexToPixel OUT = (VertexToPixel)0;
  float4x4 WorldViewProj;
  
  WorldViewProj=mul(xWorld,xView);
  WorldViewProj=mul(WorldViewProj,xProjection);
  
  OUT.Pos=mul(float4(IN.Pos.xyz,1.0), WorldViewProj);
  OUT.Pos2=mul(float4(IN.Pos.xyz,1.0), WorldViewProj);


  OUT.Pos3D=mul(float4(IN.Pos.xyz,1.0),xWorld);  
  OUT.Normal=mul(float4(IN.Normal.xyz, 0.0),xWorld);  
  OUT.UV=float4(IN.UV.xy,1.0,1.0);

  return OUT;
}

PixelToFrame flatPS(VertexToPixel IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;	
  OUT.Color = c_specular;
  return OUT;
}

PixelToFrame flat2PS(VertexToPixel IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;
  
  OUT.Color = float4(1.0,0.0,1.0,0.0);	
  return OUT;
}

PixelToFrame flat3PS(VertexToPixel IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;
  
  if(IsInShadow2(xLightPosition,IN.Pos3D.xyz)){
	OUT.Color = float4(0.0,0.0,0.0,0.0);	
  }else{
	OUT.Color = float4(1.0,1.0,1.0,0.0);
  }
  return OUT;
}

PixelToFrame flat4PS(VertexToPixel IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;
  float t = IsInShadow3(xLightPosition,IN.Pos3D.xyz);
  OUT.Color = float4(t,t,t,1);
  return OUT;
}

PixelToFrame lightedPS(VertexToPixel IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;
  
  float4 LightVector = normalize(xLightPosition-IN.Pos3D);
  float LightIntensity = dot(LightVector, normalize(IN.Normal));
  
  OUT.Color = float4(1.0,1.0,1.0,1.0)*LightIntensity;	
  return OUT;
}

PixelToFrame phongPS(VertexToPixel IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;
  
  float4 norm = normalize(IN.Normal);
  float4 LightVector = normalize(xLightPosition-IN.Pos3D);
  float4 camVector = normalize(xCameraPosition-IN.Pos3D);
  float4 norm2 = dot(norm, LightVector) * norm;
  float LightIntensity = saturate(dot(LightVector, norm));
  float4 odbity = normalize((norm2 * 2.0) - LightVector);
  float4 odbity2 = normalize(reflect(-LightVector, norm));
  float specular = pow(max(dot(odbity2, camVector), 0.0), shininess);
  
  OUT.Color = saturate(c_ambient + c_diffuse*LightIntensity)*tex2D(ColoredTextureSampler, IN.UV);
  
  OUT.Color = saturate(OUT.Color + c_specular*(specular*sqrt(LightIntensity)));	       

  return OUT;
}

PixelToFrame phongPS2(VertexToPixel IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;
  
  float4 norm = normalize(IN.Normal);
  //norm.w = 0;
  float4 LightVector = normalize(xLightPosition-IN.Pos3D);
  float4 camVector = normalize(xCameraPosition-IN.Pos3D);
  float4 norm2 = (dot(norm, LightVector)) * norm;
  float LightIntensity = saturate(dot(LightVector, norm));
  float4 odbity = normalize((norm2 * 2.0) - LightVector);
  float4 odbity2 = normalize(reflect(-LightVector, norm));
  float specular = pow(max(dot(odbity2, camVector), 0.0), shininess);
  
if(IsInShadow2(xLightPosition,IN.Pos3D.xyz))LightIntensity = 0.1;
   
  if(LightIntensity < 0.1) LightIntensity = 0.1;
  
  OUT.Color = saturate(c_ambient + c_diffuse*LightIntensity)*tex2Dbias(ColoredTextureSampler, IN.UV+float4(0,0,0,0));
  OUT.Color = saturate(OUT.Color + c_specular*(specular)*LightIntensity);	       

  return OUT;
}

PixelToFrame phongPS2final(VertexToPixel IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;
  
  float4 norm = normalize(IN.Normal);
  //norm.w = 0;
  float4 LightVector = normalize(xLightPosition-IN.Pos3D);
  float4 camVector = normalize(xCameraPosition-IN.Pos3D);
  float4 norm2 = (dot(norm, LightVector)) * norm;
  float LightIntensity = saturate(dot(LightVector, norm));
  float4 odbity = normalize((norm2 * 2.0) - LightVector);
  float4 odbity2 = normalize(reflect(-LightVector, norm));
  float specular = pow(max(dot(odbity2, camVector), 0.0), shininess);
float2 ProjectedTexCoords = 0;
ProjectedTexCoords.x = 1;
ProjectedTexCoords.y = 0;

ProjectedTexCoords.x = IN.Pos2.x/IN.Pos2.w/2.0f + 0.5f;
ProjectedTexCoords.y = -IN.Pos2.y/IN.Pos2.w/2.0f + 0.5f; 

 float uu = 1.0/512; 
 float avg = 0;
 float suma = 0;
 
 int n =2;
 
 float tmp = sqrt(n*n+n*n);
 
 for(int i = -n; i <= n; i++){
  for(int j = -n; j <= n; j++){
 float uu2 = sqrt(i*i+j*j)/tmp;
 float g = 1.0f - tex1D(gauss_s, uu2).r; 
 suma += g;
 avg += g*tex2D(smaps, ProjectedTexCoords+float2(i*uu,j*uu));
 }
 
 }
 
  avg /= suma;
 
 LightIntensity *= avg;
  
  if(LightIntensity < 0.1) LightIntensity = 0.1;
  
  OUT.Color = saturate(c_ambient + c_diffuse*LightIntensity)*tex2Dbias(ColoredTextureSampler, IN.UV+float4(0,0,0,0));
  OUT.Color = saturate(OUT.Color + c_specular*(specular)*LightIntensity);	       

  return OUT;
}


PixelToFrame phongPS2ref(VertexToPixel IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;
  
  float4 norm = normalize(IN.Normal);
  float4 LightVector = normalize(xLightPosition-IN.Pos3D);
  float4 camVector = normalize(xCameraPosition-IN.Pos3D);
  float4 norm2 = (dot(norm, LightVector)) * norm;
  float LightIntensity = saturate(dot(LightVector, norm));
  float4 odbity = normalize((norm2 * 2.0) - LightVector);
  float4 odbity2 = normalize(reflect(-LightVector, norm));
  float specular = pow(max(dot(odbity2, camVector), 0.0), shininess);

float3 R=2*dot(norm,camVector)*norm;
  R=R-camVector;
	R=normalize(R);
  
  OUT.Color = saturate(c_diffuse*LightIntensity);//*tex2Dbias(ColoredTextureSampler, IN.UV+float4(0,0,0,0));
  //OUT.Color = saturate(OUT.Color + c_specular*(specular));	  
  
  
  OUT.Color = saturate(OUT.Color + texCUBE(ReflectionCubeSampler,R));
  return OUT;
}

PixelToFrame phongPS2ref2(VertexToPixel IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;
  
  float4 norm = normalize(IN.Normal);
  float4 LightVector = normalize(xLightPosition-IN.Pos3D);
  float4 camVector = normalize(xCameraPosition-IN.Pos3D);
  float4 norm2 = (dot(norm, LightVector)) * norm;
  float LightIntensity = saturate(dot(LightVector, norm));
  float4 odbity = normalize((norm2 * 2.0) - LightVector);
  float4 odbity2 = normalize(reflect(-LightVector, norm));
  float specular = pow(max(dot(odbity2, camVector), 0.0), shininess);

float3 R=2*dot(norm,camVector)*norm;
  R=R-camVector;
	R=normalize(R);
  
  OUT.Color = saturate(c_ambient + c_diffuse*LightIntensity)*tex2Dbias(ColoredTextureSampler, IN.UV+float4(0,0,0,0));
  OUT.Color = saturate(OUT.Color + c_specular*(specular));	  
  
  float4 rr = texCUBE(rold,-R);
OUT.Color = rr;
  return OUT;
}


PixelToFrame phongPS3(VertexToPixel IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;
  
  float4 norm = normalize(IN.Normal);
  float4 LightVector = normalize(xLightPosition-IN.Pos3D);
  float4 camVector = normalize(xCameraPosition-IN.Pos3D);
  float LightIntensity = saturate(dot(LightVector, norm));
  float4 halfvec = normalize( LightVector + camVector );
  float specular = pow(saturate(dot(halfvec, norm)), shininess);
  
  if(IsInShadow2(xLightPosition,IN.Pos3D.xyz))LightIntensity = 0;
  
  OUT.Color = saturate(c_ambient + c_diffuse*LightIntensity)*tex2D(ColoredTextureSampler, IN.UV);
  if(LightIntensity > 0){
    OUT.Color = saturate(OUT.Color + c_specular*(specular));	
  } 

  return OUT;
}

VertexToPixelTex texVS(BufferToVertex IN)
{
  VertexToPixelTex OUT = (VertexToPixelTex)0;
  float4x4 WorldViewProj;
  
  WorldViewProj=mul(xWorld,xView);
  WorldViewProj=mul(WorldViewProj,xProjection);
  
  OUT.Pos=mul(float4(IN.Pos.xyz,1.0), WorldViewProj);

  OUT.Normal=mul(float4(IN.Normal.xyz, 0.0), xWorld);  
  OUT.UV=float4(IN.UV.xy,1.0,1.0);

  return OUT;
}

PixelToFrame texPS(VertexToPixelTex IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;
  
  float4 t = tex2Dbias(ColoredTextureSampler, IN.UV);
  
  OUT.Color = t;	
  return OUT;
}

PixelToFrame edgePS(VertexToPixelTex IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;
  float d = t_size * t_mod;
  float t1 =  length(-tex2D(ColoredTextureSampler, IN.UV+float4(-d,d,0,0))
            - tex2D(ColoredTextureSampler, IN.UV+float4(-d,0,0,0))*2
              -tex2D(ColoredTextureSampler, IN.UV+float4(-d,-d,0,0))
              +tex2D(ColoredTextureSampler, IN.UV+float4(d,d,0,0))
            + tex2D(ColoredTextureSampler, IN.UV+float4(d,0,0,0))*2
              +tex2D(ColoredTextureSampler, IN.UV+float4(d,-d,0,0)));
              
  float t2 =  length(-tex2D(ColoredTextureSampler, IN.UV+float4(-d,d,0,0))
            - tex2D(ColoredTextureSampler, IN.UV+float4(0,d,0,0))*2
              -tex2D(ColoredTextureSampler, IN.UV+float4(d,d,0,0))
              +tex2D(ColoredTextureSampler, IN.UV+float4(-d,-d,0,0))
            + tex2D(ColoredTextureSampler, IN.UV+float4(0,-d,0,0))*2
              +tex2D(ColoredTextureSampler, IN.UV+float4(d,-d,0,0)));
  
  float t = sqrt(t1*t1 + t2*t2);	
  OUT.Color = float4(t1,t2,0,1);	
  return OUT;
}

PixelToFrame edge2PS(VertexToPixelTex IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;
  float d = t_size * t_mod;
  float t1 =  (-length(tex2D(ColoredTextureSampler, IN.UV+float4(-d,d,0,0)))
               -length(tex2D(ColoredTextureSampler, IN.UV+float4(-d,0,0,0)))*2
               -length(tex2D(ColoredTextureSampler, IN.UV+float4(-d,-d,0,0)))
               +length(tex2D(ColoredTextureSampler, IN.UV+float4(d,d,0,0)))
               +length(tex2D(ColoredTextureSampler, IN.UV+float4(d,0,0,0)))*2
               +length(tex2D(ColoredTextureSampler, IN.UV+float4(d,-d,0,0))));
              
  float t2 =  (-length(tex2D(ColoredTextureSampler, IN.UV+float4(-d,d,0,0)))
               -length(tex2D(ColoredTextureSampler, IN.UV+float4(0,d,0,0)))*2
               -length(tex2D(ColoredTextureSampler, IN.UV+float4(d,d,0,0)))
               +length(tex2D(ColoredTextureSampler, IN.UV+float4(-d,-d,0,0)))
               +length(tex2D(ColoredTextureSampler, IN.UV+float4(0,-d,0,0)))*2
               +length(tex2D(ColoredTextureSampler, IN.UV+float4(d,-d,0,0))));
  
  float t = sqrt(t1*t1 + t2*t2);	
  OUT.Color = float4(t1*0.5 + 0.5,t2*0.5 + 0.5,0,1);
  return OUT;
}

PixelToFrame edge3PS(VertexToPixelTex IN) 
{
  PixelToFrame OUT = (PixelToFrame)0;
  float d = t_size * t_mod;
  float t1 =  (-length(tex2D(ColoredTextureSampler, IN.UV+float4(-d,d,0,0)))
               -length(tex2D(ColoredTextureSampler, IN.UV+float4(-d,0,0,0)))*2
               -length(tex2D(ColoredTextureSampler, IN.UV+float4(-d,-d,0,0)))
               +length(tex2D(ColoredTextureSampler, IN.UV+float4(d,d,0,0)))
               +length(tex2D(ColoredTextureSampler, IN.UV+float4(d,0,0,0)))*2
               +length(tex2D(ColoredTextureSampler, IN.UV+float4(d,-d,0,0))));
              
  float t2 =  (-length(tex2D(ColoredTextureSampler, IN.UV+float4(-d,d,0,0)))
               -length(tex2D(ColoredTextureSampler, IN.UV+float4(0,d,0,0)))*2
               -length(tex2D(ColoredTextureSampler, IN.UV+float4(d,d,0,0)))
               +length(tex2D(ColoredTextureSampler, IN.UV+float4(-d,-d,0,0)))
               +length(tex2D(ColoredTextureSampler, IN.UV+float4(0,-d,0,0)))*2
               +length(tex2D(ColoredTextureSampler, IN.UV+float4(d,-d,0,0))));
  
  float t = sqrt(t1*t1 + t2*t2);
  
  OUT.Color = float4(t,t,t,1);	
  return OUT;
}

// ---- CUBE DEPTH --------------------------------

PSCubeIn cubedepthVS( float4 inPosition : POSITION )
{
    PSCubeIn output;

    float4x4 WorldViewProj;
    WorldViewProj=mul(xWorld,xView);
    WorldViewProj=mul(WorldViewProj,xProjection);
    
    float4 positionW = mul( inPosition, xWorld );
    output.oPositionLight = mul( inPosition, WorldViewProj );
    
    output.lightVec = xLightPosition.xyz - positionW.xyz; 

    return output;
}  

float4 cubedepthPS( PSCubeIn In ) : COLOR0
{
    float3 Color=float3(1,1,1)*(length(In.lightVec) + 0.2);
	return float4(Color.xyz,1); 
   
} 

// ------------ TECHNIQUES --------------

technique lighted{
	pass p0 {
		VertexShader = compile vs_3_0 lightedVS();
		PixelShader = compile ps_3_0 phongPS();
	}
}

technique lighted2{
	pass p0 {
		VertexShader = compile vs_3_0 lightedVS();
		PixelShader = compile ps_3_0 phongPS2();
	}
}

technique lighted2final{
	pass p0 {
		VertexShader = compile vs_3_0 lightedVS();
		PixelShader = compile ps_3_0 phongPS2final();
	}
}

technique lighted2ref{
	pass p0 {
		VertexShader = compile vs_3_0 lightedVS();
		PixelShader = compile ps_3_0 phongPS2ref();
	}
}

technique lighted2ref2{
	pass p0 {
		VertexShader = compile vs_3_0 lightedVS();
		PixelShader = compile ps_3_0 phongPS2ref2();
	}
}

technique lighted3{
	pass p0 {
		VertexShader = compile vs_3_0 lightedVS();
		PixelShader = compile ps_3_0 phongPS3();
	}
}

technique flat{
	pass p0 {
		VertexShader = compile vs_3_0 lightedVS();
		PixelShader = compile ps_3_0 flatPS();
	}
}

technique flat2{
	pass p0 {
		VertexShader = compile vs_3_0 lightedVS();
		PixelShader = compile ps_3_0 flat2PS();
	}
}

technique flatshadow{
	pass p0 {
		VertexShader = compile vs_3_0 lightedVS();
		PixelShader = compile ps_3_0 flat3PS();
	}
}

technique shadowtest{
	pass p0 {
		VertexShader = compile vs_3_0 lightedVS();
		PixelShader = compile ps_3_0 flat4PS();
	}
}

technique tex1{
	pass p0 {
		VertexShader = compile vs_3_0 texVS();
		PixelShader = compile ps_3_0 texPS();
	}
}

technique edge{
	pass p0 {
		VertexShader = compile vs_3_0 texVS();
		PixelShader = compile ps_3_0 edgePS();
	}
}

technique edge2{
	pass p0 {
		VertexShader = compile vs_3_0 texVS();
		PixelShader = compile ps_3_0 edge2PS();
	}
}

technique edge3{
	pass p0 {
		VertexShader = compile vs_3_0 texVS();
		PixelShader = compile ps_3_0 edge3PS();
	}
}

technique cubedepth{
	pass p0 {
		
		VertexShader = compile vs_3_0 cubedepthVS();
		PixelShader = compile ps_3_0 cubedepthPS();
	}
}